<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .container{
            position: relative;
            float: right;
            height: 40px;
            width: 120px;
            background-color: lightgray;
        }
        .car{
            position: absolute;
            line-height: 40px;
            width: 120px;
            text-align: center;
            top: 0;
            right: 0;

        }
        .box{
            position: absolute;
            top: 40px;
            right: 0;
            height: 100px;
            width: 300px;
            background-color: orange;
            display: none;
        }
    </style>
    <script src="jquery.3.4.1.js"></script>

</head>
<body>
<div class="container">
    <div class="car">购物车(<span>0</span>)</div>
    <div class="box"></div>
</div>
</body>
<script>
    $('.car').click(
        function () {
            $('.box').css('display','block')
        }
    )
</script>
</html>